package problem191;

//191.位1的个数
//https://leetcode.cn/problems/number-of-1-bits/

class Solution {
    public int hammingWeight(int n) {
        int ret = 0;
        for(int i = 0; i<32; i++) {
            ret += (n >> i) & 1;
        }
        return ret;
    }
}